﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NewTools
{
    internal class FileOperation
    {
        private string filePath = "\\Resource\\config\\";
        private static FileOperation instance;

        public static FileOperation GetInstance()
        { 
            if (instance == null)
                instance = new FileOperation();
            return instance;
        }
        public FileOperation()
        {
            filePath = System.Environment.CurrentDirectory + filePath;
        }

        public string [] GetModelItemsByFolder()
        {
            
            string [] items = Directory.GetDirectories(filePath);
            string [] strings = new string[items.Length];

            for (Int32 i = 0; i < items.Length; i++)
            {
                DirectoryInfo directoryInfo = new DirectoryInfo(items[i]);
                strings[i] = directoryInfo.Name;   
            }
            return strings;
        }

        public string GetAutoRunFileName(string floderName)
        {    
            return filePath + "\\" + floderName + "\\" + floderName + ".ini";
        }

    }
}
